﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogin_Click(object sender, EventArgs e)
    {
        String ClientNumber = txtUser.Text;
        String Password = txtPassword.Text;
        try
        {
            localhost.Service server = new localhost.Service();
            if (server.LoginBank(ClientNumber, Password).Rows.Count > 0)
            {
                Response.Redirect("ListAccount.aspx?CN="+ClientNumber);
            }
            else
            {
                string prompt = "<script>$(document).ready(function(){{$.prompt('{0}!');}});</script>";
                string message = string.Format(prompt, "Không thể login ! sai tài khoản hoặc mật khẩu");
                this.Page.ClientScript.RegisterStartupScript(typeof(Page), "alert", message);
            }
        }
        catch (Exception)
        {
        }

    }
}
